package framework.mybatis.xml.entity;

import org.apache.ibatis.type.Alias;

import java.util.StringJoiner;

/**
 * 默认别名为 首字母小写，可使用 @Alias 自定义
 */
@Alias("UserXml")
public class User {

    private Integer id;
    private String name;
    private Integer age;

    public User(Integer id) {
        this.id = id;
    }

    public User(Integer id, String name, Integer age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", User.class.getSimpleName() + "[", "]")
                .add("id=" + id)
                .add("name='" + name + "'")
                .add("age=" + age)
                .toString();
    }
}
